/*
 * Copyright (C) 2012-2016 TeraCN
 * 
 * This file is part of TeraCN.
 * 
 * TeraCN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TeraCN is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package tera.gameserver.network;

/**
 * @author Ronn Mod Evestu
 */
public enum ServerPacketType
{
	AUTH_ATTEMPT(0x4DBC),
	AUTH_FAILED(0xD5A2),
	S_REMAIN_PLAY_TIME(0xDEC6),
	S_LOGIN_ARBITER(0xC8EF),
	S_LOGIN_ACCOUNT_INFO(0x9BB5),
	S_GET_USER_LIST(0x782C),
	S_UPDATE_CONTENTS_ON_OFF(0x7ED1),
	S_CONFIRM_INVITE_CODE_BUTTON(0xE203),
	S_ACCOUNT_PACKAGE_LIST(0x88C6),
	S_LOADING_SCREEN_CONTROL_INFO(0xB6EE),
	
	S_UNION_SUMMARY(0x6774),
	S_TRADE_BROKER_HIGHEST_ITEM_LEVEL(0x7637),
	S_CHECK_USERNAME(0xE2A9),
	
	PLAYER_DELETE_RESULT(0xA550),
	S_CAN_CREATE_USER(0x98B6),
	
	PLAYER_BANK(0xB2E4),
	S_ARTISAN_SKILL_LIST(0xC498),
	S_PET_INCUBATOR_INFO_CHANGE(0xA2CF),
	S_PET_INFO_CLEAR(0xB96A),
	S_VIRTUAL_LATENCY(0x5526),
	S_MOVE_DISTANCE_DELTA(0x88D7),
	S_MY_DESCRIPTION(0x9311),
	
	S_LOAD_HINT(0x87C7),
	SETTINGS(0x5333),
	
	HOT_KEY_CHANGED(0xB023),
	S_AVAILABLE_SOCIAL_LIST(0xF511),
	S_ARTISAN_RECIPE_LIST(0x923F),
	S_NPCGUILD_LIST(0xE704),
	S_F2P_PremiumUser_Permission(0xF7EB),
	S_NOTIFY_CHANGE_CLASS_AND_ELITE(0xF62F),
	S_MASSTIGE_STATUS(0xF337),
	S_AVAILABLE_EVENT_MATCHING_LIST(0xC6D4),
	S_USER_EXTERNAL_CHANGE(0xB6E4),
	S_USER_ITEM_EQUIP_CHANGER(0xB92C),
	S_FESTIVAL_LIST(0xAD5C),
	S_SEND_USER_PLAY_TIME(0x5005),
	S_PCBANGINVENTORY_DATALIST(0xF77C),
	S_SIMPLE_TIP_REPEAT_CHECK(0xCF26),
	S_GUARD_PK_POLICY(0xE3A6),
	GUILD_CHECK_NAME(0x8D0C),
	GUILD_MEMBERS(0xBEA6),
	GUILD_INFO(0xE49A),
	GUILD_INPUT_NAME(0xE224),
	GUILD_LOGS(0x942E),
	GUILD_LOAD_ICON(0x648F),
	GUILD_ICON_INFO(0xB229),
	GUILD_BANK(0xB2E4),
	FRIEND_LIST_INFO(0xD342),
	FRIEND_LIST_STATE(0xB6EF),
	TEST_29(0xB917),
	TEST_24(0x6DDF),
	TEST_25(0x7C1A),
	S_ACCOUNT_BENEFIT_LIST(0xC264),
	TEST_30(0x9131),
	TEST_27(0x8118),
	S_SPAWN_ME(0xEFDA),
	TEST_35(0x99EC),
	S_PLAYER_STAT_UPDATE(0xD0F4),
	TEST_32(0x6B95),
	S_REIGN_INFO(0xD408),
	S_VISIT_NEW_SECTION(0xC558),
	QUEST_COMPLETE_LIST(0x88),
	
	S_QUEST_INFO(0xF7F2),
	S_TOGGLE_TASK_INFO_WINDOW_ON(0xBF7B),
	S_TOGGLE_TASK_INFO_WINDOW_OFF(0xBF7B),
	S_QUEST_VILLAGER_INFO(0x52D1),
	S_COMPLETED_MISSION_INFO(0xB8AB),
	QUEST_SPLIT_LIST(0xB33F),
	S_UPDATE_QUEST(0xF3CC),
	S_PLAY_MOVIE(0xF003),
	QUEST_INFO(0xB25E),
	S_DAILY_QUEST_COMPLETE_COUNT(0xBC2C),
	EVENT_MESSAGE(0x91E5),
	S_NPC_LOCATION(0xA91D),
	S_START_CLIMBING(0xCA4D),
	S_INSTANT_MOVE(0xFFA7),
	S_CHAT(0xC62C),
	S_DESPAWN_NPC(0xC960),
	S_USER_STATUS(0x6381),
	S_CREATURE_ROTATE(0x593A),
	PLAYER_INFO(0xBA9A),
	PLAYER_PVP_ON(0xBF3C),
	PLAYER_PVP_OFF(0xD224),
	PLAYER_MOVE(0x0A44),
	S_CREATURE_CHANGE_HP(0x8562),
	S_PLAYER_CHANGE_MP(0xB071),
	S_PLAYER_CHANGE_EXP(0xB584),
	S_USER_LEVELUP(0xA417),
	S_MOUNT_VEHICLE(0xBBF1),
	S_UNMOUNT_VEHICLE(0x8548),
	CHAR_DEAD(0x7E30),
	CHAR_STATE(0xC41E),
	PLAYER_DEAD_WINDOW(0x7380),
	PLAYER_LORD_NUM(0xCD5F),
	S_SOCIAL(0xE39D),
	REACTION(0xC143),
	S_EACH_SKILL_RESULT(0xC16C),
	TARGET_CURRENT_HP(0x1111),
	S_SHOW_HP(0x5DBA),
	NOTIFY_CHARACTER(0xC4DD),
	NPC_STATE(0x985B),
	RESIST_EFFECT(0x985B),
	SUMMON_INFO(0x6B57),
	S_SPAWN_BONFIRE(0x5D45),
	S_DESPAWN_BONFIRE(0xB3C0),
	CHARM_SMOKE(0xA238),
	S_SPAWN_NPC(0x64D1),
	NPC_PLAYABLE_INFO(0x6B57),
	S_DIALOG_EVENT(0x5A5B),
	S_NPC_MENU_SELECT(0xAC3A),
	S_DIALOG(0xB25E),
	S_NPC_STATUS(0x8054),
	NPC_BANK(0x0),
	NPC_BANK_PANEL(0xD521),
	NPC_DIALOG_REPLY(0x7236),
	NPC_DIALOG_REPLY_SHOP(0xB205),
	NPC_DIALOG_SKILL_LEARN(0xB494),
	NPC_DIALOG_SKILL_LEARN_PANEL(0x7880),
	ITEM_SHOP_TRADE(0x7CEF),
	MULTI_SHOP(0x6C91),
	OBJECT_POSITION(0xE6C7),
	S_ACTION_STAGE(0xA61B),
	CHARGE_SKILL_START(0x988F),
	SKILL_MOVE(0xA7B7),
	SKILL_END_S_ACTION_END(0xBC92),
	S_ACTION_END(0xBC92),
	SKILL_REUSE(0x8A0B),
	SKILL_FAST_SHOT(0xC372),
	SKILL_SLOW_SHOT(0xE8BB),
	SKILL_NPC_SLOW_SHOT(0xB0D6),
	SKILL_DELETE_SHOT(0xC7BB),
	SKILL_LEASH(0xC2F6),
	SKILL_LOCK_ATTACK(0xA1C1),
	SKILL_LOCK_TARGET(0xCCE8),
	SHIELD_BLOCK(0xDAFE),
	S_ABNORMALITY_BEGIN(0x8846),
	APPLED_CHARM_PACKET(0xBB75),
	S_ABNORMALITY_END(0xE445),
	CANCEL_CHARM_EFFECT(0x9DE4),
	TRAP_INFO(0x9F1F),
	TRAP_DELETE(0x6772),
	S_LOOT_DROPITEM(0x54F6),
	S_SPAWN_DROPITEM(0xB0A5),
	ITEM_TEMPLATE_INFO(0x783C),
	S_DESPAWN_DROPITEM(0x7EC1),
	ITEM_REUSE(0xE7C5),
	PLAYER_EQUIPMENT(0xD3B9),
	S_SHOW_ITEM_TOOLTIP(0x783C),
	PLAYER_RESTART(0x74A1),
	PLAYER_RESTART_CANCEL_OK(0xC9B2),
	S_PREPARE_EXIT(0xD34A),
	PLAYER_EXIT_CANCEL_OK(0xE755),
	PLAYER_INCREASE_LEVEL(0xD7DE),
	PLAYER_ACTION_DONED(0x86D4),
	PLAYER_ACTION_INVITE(0xC8F1),
	ACTION_START(0xA924),
	PLAYER_WAITING_ACTION(0x7880),
	PARTY_INFO(0xFF77),
	PARTY_MEMBER_INFO(0xB932),
	PARTY_MEMBER_EFFECT(0xB14F),
	PARTY_LEAVE(0x55DA),
	PARTY_MEMBER_COORDS(0x8954),
	NAME_COLOR(0x5A29),
	OPEN_TRADE(0xB549),
	CLOSE_TRADE(0xA2F2),
	DUEL_START(0x72AD),
	CANCEL_TARGET_HP(0xF470),
	TP1(0x8293),
	PUT_AN_PEGAS(0x57E9),
	FLY_PEGAS(0xB9AD),
	FLY_PEGAS_REPLY_PACKET(0xd9c2),
	DEPARTURE_PORTAL(0x1111),
	STATE_ALLOWED(0x71C3),
	GET_OFF_PEGAS(0xB63E),
	ROUTE_PEGAS(0xEFA6),
	TELEPORT_POINTS(0xA5F7),
	PLAYER_ACTION_START(0xBEB7),
	DUEL_END(0x2C88),
	DUEL_END_OK(0xCC79),
	DUEL_END_OK2(0x63BB),
	RIVALS(0xE58B),
	RESOURSE_INFO(0xAB9D),
	RESOURSE_REMOVE(0xC0D6),
	RESOURSE_START_COLLECT(0xFB4E),
	RESOURSE_END_COLLECT(0x9D3F),
	RESOURSE_INCREASE_LEVEL(0xE49B),
	RESOURSE_COLLECT_PROGRESS(0xA671),
	CONNECT_SUCCESSFUL(0xFFFE),
	SERVER_KEY(0xFFFF),
	DEVELOPER_PACKET(0xFFFD),
	S_MY_CONDITION(0x92D0),
	S_SYSTEM_MESSAGE(0x91E5),
	MESSAGE_ADD_ITEM(0xB79F),
	ENCHANT_ITEM_DIALOG_INFO(0xFCEC),
	ENCHANT_RESULT(0xC06B),
	
	//////////////////// 国服
	S_ENTER_SELECT_PROFESSION(0xAD80), // 进入职业选择界面
	S_STR_EVALUATE_LIST(0x51C2), // 用户名是否可用
	S_CREATE_USER(0xB5A8), // 创建角色返回
	S_LOAD_CLIENT_ACCOUNT_SETTING(0x554), // 返回角色信息
	S_SELECT_USER(0xA646), // 选择人物
	S_BROCAST_GUILD_FLAG(0xDF27),
	S_LOGIN(0x9D72),
	S_CURRENT_ELECTION_STATE(0x4EA1), // 返回当前选择状态
	S_CLEAR_QUEST_INFO(0xA2BD),
	S_ONGOING_HUNTING_EVENT_LIST(0x4EF2),
	S_INVEN(0x7573),
	S_LOAD_TOPO(0xDFB0),
	S_SKILL_LIST(0x659B),
	S_SELECT_USER1(0xD271),
	S_SELECT_USER2(0x4EF2),
	S_SELECT_USER3(0xA2BD),
	S_SELECT_USER4(0xD321),
	S_SELECT_USER5(0xA8E6),
	S_SELECT_USER6(0xDF21),
	S_SELECT_USER7(0xF095),
	S_SELECT_USER8(0xBD27),
	S_SELECT_USER9(0xE5BA),
	S_SELECT_USER10(0xF772),
	S_SELECT_USER11(0x7793),
	S_SELECT_USER12(0xCA00),
	
	S_ENTER_WORLD_CONFIRM(0x566B),
	
	;
	
	public static final int LENGTH = values().length;
	
	public static final void init()
	{
		ITEM_TEMPLATE_INFO.set(S_SHOW_ITEM_TOOLTIP);
		QUEST_INFO.set(S_DIALOG);
		S_ACTION_END.set(SKILL_END_S_ACTION_END);
		SUMMON_INFO.set(S_SPAWN_NPC);
		GUILD_CHECK_NAME.set(S_STR_EVALUATE_LIST);
		FLY_PEGAS_REPLY_PACKET.set(PLAYER_WAITING_ACTION);
		DEPARTURE_PORTAL.set(FLY_PEGAS);
		GUILD_BANK.set(PLAYER_BANK);
		EVENT_MESSAGE.set(S_SYSTEM_MESSAGE);
		SKILL_NPC_SLOW_SHOT.set(TRAP_INFO);
		NPC_PLAYABLE_INFO.set(PLAYER_INFO);
	}
	
	private int opcode;
	
	/**
	 * Constructor for ServerPacketType.
	 * @param opcode int
	 */
	private ServerPacketType(int opcode)
	{
		this.opcode = opcode;
	}
	
	/**
	 * Method getOpcode.
	 * @return int
	 */
	public int getOpcode()
	{
		return opcode;
	}
	
	/**
	 * Method setOpcode.
	 * @param opcode int
	 */
	public void setOpcode(int opcode)
	{
		this.opcode = opcode;
	}
	
	/**
	 * Method set.
	 * @param type ServerPacketType
	 */
	public void set(ServerPacketType type)
	{
		opcode = type.opcode;
	}
}